Method for flicker detection in image signal

ABSTRACT

The present invention provides an effective flicker detection method performing a motion compensation. The present invention includes the steps of: calculating a luminance difference between neighboring pixels; summing up the luminance difference in a specific direction if the difference is greater than a threshold value; performing a motion estimation by using a sum calculated through step (b) to thereby calculate a motion displacement; performing a motion compensation to a current frame data by using the motion displacement; calculating a difference between a previous frame data and the compensated current frame data; and detecting the flicker by using the difference calculated in step (e).

FIELD OF INVENTION

The present invention relates to a flicker detection method in an image signal; and, more particularly, to an effective method for a flicker detection with performing a motion compensation between frames of image data constituted with plural image signals.

DESCRIPTION OF PRIOR ART

Charge-coupled devices (CCD) were the only image sensors used in a digital image medium until recently. However, there is a less expensive alternative, e.g., a complementary metal oxide semiconductor (CMOS) image sensor. The CCD sensors offer superior image performance and flexibility. However, the size of the CCD is large compare with the CMOS image sensor. On the other hand, the CMOS image sensors offer more integration, lower power dissipation, and smaller system size although image quality and flexibility of the CMOS image sensor are far below than the CCD. The CMOS image sensors are suitable to high-volume, space-constrained applications where image quality is not critical, e.g., a camera of a mobile telephone, a security camera, a PC peripheral, toys, and some automotive applications. However, great advances have been achieved and CMOS image sensors with quality comparable to CCD sensors can be produced. Because of the above mentioned advantages, the CMOS image sensor is, therefore, used extensively.

However, when various light sources are used for the CMOS image sensor, a flicker can be generated. When each line of a pixel array in the CMOS image sensor receives different light sources, each line has different luminance. Thus, an additional band is appeared in each line on an image. The additional band is called as the flicker.

FIG. 1 is a diagram explaining a case when a flicker occurs.

As shown, an amount of energy inputted to each line of a CMOS image sensor varies according to a quantity of inputted light and an exposing time of the CMOS image sensor. Due to a difference of the amount of energy inputted to each line, the flicker occurs in the CMOS image sensor. This flicker degrades a quality of the image. Thus, the flicker should be remedied to thereby improve the quality of the image.

There have been many efforts to remove the flickers. The most famous three methods are a method using a super resolution pixel, a frequency detection through a transform, and a method for removing the flicker by obtaining a flicker period through detecting a flicker factor from the image itself. However, the method using the super resolution pixel is hard to implement. The frequency detection is hard to find an accurate frequency. Further, the method of obtaining the period is difficult to detect only the flicker factor. Particularly, in order to detect a flicker from the image signal, a image difference between a previous frame image and a current frame image is frequently used. However, the image difference is caused not only by the flicker also by a motion, e.g., a hand tremble. Therefore, it is unreasonable to detect the flicker only by extracting the image difference.

SUMMARY OF INVENTION

It is, therefore, an object of the present invention to provide a flicker detection method performing a motion compensation.

In accordance with an aspect of the present invention, there is provided a flicker detection method for detecting a flicker from an image signal outputted through MXN pixels. Herein the M and N are natural numbers. The flicker detection of the present invention includes the steps of: (a) calculating a luminance difference between neighboring pixels; (b) summing up the luminance difference in a specific direction if the difference is greater than a threshold value; (c) performing a motion estimation by using a sum calculated through step (b) to thereby calculate a motion displacement; (d) performing a motion compensation to a current frame data by using the motion displacement; (e) calculating a difference between a previous frame data and the compensated current frame data; and (f) detecting the flicker by using the difference calculated in step (e).

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects and features of the present invention will become apparent from the following description of preferred embodiments taken in conjunction with the accompanying drawings, in which:

FIG. 1 is a diagram explaining a case when a flicker occurs;

FIG. 2 is a flow chart describing a flicker detection algorism in accordance with the present invention;

FIGS. 3A to 3C are diagrams explaining a data process method for use in a motion estimation;

FIG. 4 is a diagram showing a motion estimation process;

FIG. 5 is a magnified diagram of W2 shown in FIG. 3C;

FIG. 6 is a diagram showing an operation result of the present invention.

DETAILED DESCRIPTION OF INVENTION

Hereinafter, a method for detection of a flicker in an image signal in accordance with the present invention will be described in detail referring to the accompanying drawings.

The present invention is based on a method of detecting a flicker from an image. As above mentioned, the method should detect only the flicker from an image difference between a previous frame and a current frame including both the flicker and motions, e.g., a hand tremble.

Thus, in order to obtain a difference between a current frame and a previous frame, the present invention performs a motion estimation to thereby compensate the motions. By compensating the motions through the motion estimation, most distortion of image caused by the motions can be removed from the image difference and, thus, a difference caused by the flicker can be obtained accurately.

Meanwhile, if a frame memory is used for the motion estimation, a system size is increased. In order to reduce a required system size, the present invention performs a predetermined operation to thereby perform the motion estimation with small amount of data. Through the operation, the minimum data necessary for the motion estimation is selected and used for the motion estimation.

A flicker is occurred because a frequency of a light source and a frequency of an exposing time of a CMOS image sensor are different. Particularly, a fluorescent lamp is operated in a low frequency, e.g., 50 Hz or 60 Hz. Meanwhile, the exposing time of the CMOS image sensor is generally dozens of milli-seconds (ms). Thus, when the fluorescent lamp is used for the light source of the CMOS image sensor, the flicker can be occurs.

The present invention detects the flicker as following sequence: obtaining a data required for a motion estimation; performing the motion estimation; performing a motion compensation; calculating a difference between a motion compensated data and a previous data; filtering the difference by using a low pass filter to thereby detect local minima of the difference; analyzing a distance of the two local minima to thereby obtain a period of the difference; and determining whether the flicker occurs or not by analyzing the period.

FIG. 2 is a flow chart describing a flicker detection algorism in accordance with the present invention.

As shown, a method for detecting a flicker from an image signal outputted in M×N pixels is as follows (herein, the M and N are natural numbers): calculating a luminance difference between neighboring pixel data (S201); comparing the luminance difference with a threshold value ΔTh (S202); adding the luminance difference in a specific direction, e.g., a row direction and a column direction when the luminance difference is greater than the threshold value ΔTh (S203); discarding the luminance difference when the luminance difference is less than the threshold value ΔTh (S204); performing a motion estimation (S205); calculating a motion displacement MD (S206); performing a motion compensation about a present frame data by using the motion displacement MD (S207); calculating a difference between the compensated current frame data and a previous frame data in the specific direction, e.g., the row direction and the column direction (S208); and detecting the flicker by using the difference between the frame data (S209).

Passing through the steps S201 to S204, the flicker in the image signal is partially removed. Meanwhile, instead of comparing every pixel data in a frame, only the neighboring pixel data are compared to thereby calculate the luminance difference. Thus, the motion estimation can be performed by using one line memory instead of using the whole frame memory.

At the steps S205 and S206, before generating the motion displacement MD, a sum of absolute difference SAD is calculated by moving a search window in a search range while an initial position of the motion estimation which is randomly chosen is set as a standard. A minimum factor of the SAD is selected as the motion displacement MD.

At the step S207, the motion compensation of the current frame data is actually performed by moving the previous frame data as much as the motion displacement of the current frame data.

At the step S209, in order to detect the flicker, the difference between the frame data is low filtered to thereby find local minima of the difference. Then, by finding a distance between two local minima, a flicker period is calculated. The flicker period is compared with a predetermined detection period for thereby determining whether the flicker is occurred or not. If the flicker period coincides with the detection period, it is considered that the flicker is occurred.

Meanwhile, the motion estimation is used importantly in standards for coded representation of digital audio and video, e.g., MPEG-2, H.263, and H.264. The motion estimation refers a method of compensating displacements between consecutive video frames induced by moving objects and scene changes to thereby reduce the image difference between a current frame and a previous frame.

FIGS. 3A to 3C are diagrams explaining a data process method for use in the motion estimation.

Generally, a frame memory is required to perform the motion estimation. However, it is hard to implement a one-chip COS image sensor including the frame memory because a hardware burden is overgrown.

In stead of using the frame memory, the present invention uses a line memory for performing the motion estimation by adding a difference between each neighboring pixels in a specific direction, e.g., a row direction and a column direction. Herein, the present invention performs the addition in the row direction. However, it is hard to correctly perform the motion estimation only by adding pixel values in the row direction because the summation may distorts some of the pixel values important for the motion estimation.

Accordingly, a new data S_(T)(j) for use in the motion estimation is defined by Equation 1 below. $\begin{matrix} {{S_{T}(j)} = {\sum\limits_{i = 1}^{L - 1}\quad{\phi\left( {p_{i,j,T},p_{{i - 1},j,T}} \right)}}} & \left( {{Eq}.\quad 1} \right) \end{matrix}$

In Equation 1, p_(i,j,T) denotes a pixel arranged in an i_(th) row and a j_(th) column of a T_(th) frame; L denotes a width of the frame; and j denotes a height of the frame. Further, a function φ is defined by Equation 2 below. $\begin{matrix} {{\phi\left( {a,b} \right)} \equiv \left\{ \begin{matrix} {{a - b}} & {{{if}\quad{{a - b}}} \geq \Delta_{Th}} \\ 0 & {otherwise} \end{matrix} \right.} & \left( {{Eq}.\quad 2} \right) \end{matrix}$

Herein, Δ_(Th) denotes a predetermined threshold value.

A pixel having great difference with neighboring pixels, i.e., having a large |a−b| value also has a great difference with a previous pixel at the motion estimation. Therefore, due to Equation 1, it is allowable to add only pixels having large difference to thereby obtain the motion displacement MD. Further, the motion estimation can be performed more correctly by removing unnecessary values whose |a−b| is less than the threshold value Δ_(Th). Moreover, by obtaining the difference between the neighboring pixels, the motion estimation can be performed with a data that a flicker is removed, because the flickers between the neighboring pixels are almost the same. Accordingly, when the data S_(T)(j) obtained via Equation 1 is used for the motion estimation, the less hardware is required for reliably calculating the motion displacement MD.

After collecting the current frame data and the previous frame data through Equation 1, the motion estimation is performed through the following Equation 3 below. $\begin{matrix} {{{{SAD}(v)} = {\sum\limits_{j = {off}}^{{BS} + {off}}\quad{{{S_{T}(j)} - {S_{T - 1}\left( {j + v} \right)}}}}},{v\quad{\varepsilon\left\lbrack {{- {SR}},{+ {SR}}} \right\rbrack}}} & \left( {{Eq}.\quad 3} \right) \end{matrix}$

In Equation 3, ‘BS’ denotes a block size that the motion estimation will be performed; ‘off’ denotes an initial position of the motion estimation; ‘SR’ denotes the search range.

FIG. 3B describes the calculation of the difference between the frame data without compensating the motion displacement MD. As shown in W1, a result of the calculation without compensating the motion displacement MD is irregular wave form and, therefore, it is impossible to find a period.

FIG. 3C shows the calculation of the difference between the frame data with compensating the motion displacement MD to thereby detect the flicker. As shown in W2, a result of the calculation with the motion compensation has a predetermined period. This period is used to detect the flicker.

FIG. 4 is a diagram showing a motion estimation process.

As shown, the motion estimation is performed by passing through a scan and a SAD calculation. Herein, an area drawn a deviant crease represents the search window SW, i.e., the block size BS. The search window SW can move bidirectionally, for example, from upside to bottom and vice versa as shown in FIG. 4.

When the SAD is defined as Equation 3, a final motion displacement MD is defined as follows. MD=arg(min{SAD(v)})  (Eq. 4)

In Equation 4, the minimum value of the SAD is able to be found by an operator ‘min’. The final motion displacement MD value is determined by an operator ‘arg’ which returns an argument v having the minimum SAD value.

After the motion displacement MD is selected, the motion compensation is performed. The motion compensation does not use the data generated via Equation 1 but use a value generated by Equation 5 below. $\begin{matrix} {{U_{T}(j)} = {\sum\limits_{i = 1}^{L}\quad p_{i,j,T}}} & \left( {{Eq}.\quad 5} \right) \end{matrix}$

U_(T)(j) is a sum of the pixels in one row of a certain frame.

Further, an error of the motion compensation is difined as follows. ε(j)=U _(T)(j)−U _(T-1)(j+MD)  (Eq. 6)

By using the compensation error ε(j), a flicker period is determined. Generally, Equation 6 includes many noises. Thus, before determining the flicker period, the noises are filtered by a low pass filter. If a period of local minima of the low filtered data, i.e., the flicker period corresponds to a predetermined detection period, the filtered data is determined as the flicker. When a number of the local minima whose flicker period is corresponding to the detection period in a certain frame is greater than a predetermined number, the corresponding frame is considered that the flicker is occurred.

FIG. 5 is a magnified diagram of W shown in FIG. 3C to thereby explain a detection of the flicker period by using the local minima of the compensation error and a determination of the flicker. Herein, Ppt denotes a previous value of a wave; Cpt denotes a current value of the wave; Fpt denotes a following value of the wave. When the current value Cpt is the least value from the Ppt, Cpt, and Fpt, the current value Cpt becomes the local minima. A period of the local minima, i.e., the flicker period is counted to thereby detect the flicker.

Meanwhile, local maxima can be used instead of the local minima. When the current value Cpt is most value from the Cpt, Ppt, and Fpt, the current value becomes the local maxima.

FIG. 6 is a diagram showing an operation result of the present invention.

As shown, a horizontal axis represents a frame number; a vertical axis represents the number of local minima whose flicker period is different from the detection period. Herein, the flicker period is detected by the flicker detection method performing the motion compensation. If the number of local minima whose flicker period is different from the detection period in a certain frame is more than 3, it is determined that the frame does not include the flicker. As shown in FIG. 8, the present invention correctly detects the flickers in 89 frames of 100 frames.

As abovementioned, the present invention performs the flicker detection unlike the conventional art that detects the flicker simply by calculating the difference between the previous frame and the current frame. That is, the present invention compensates the motion, e.g., a hand tremble to thereby detect the flicker by using the compensated frame data. Accordingly, the present invention is able to detect the flicker reliably and, further, improve the quality of an image.

The present application contains subject matter related to Korean patent application No. 2004-59479, filed in the Korean Patent Office on Jul. 29, 2004, the entire contents of which being incorporated herein by reference.

While the present invention has been described with respect to the particular embodiments, it will be apparent to those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims. 

1. A flicker detection method for detecting a flicker from an image signal, comprising the steps of: (a) calculating a luminance difference between neighboring pixels; (b) summing up the luminance difference in a predetermined direction if the difference is greater than a threshold value; (c) performing a motion estimation by using a sum calculated through step (b) to thereby calculate a motion displacement; (d) performing a motion compensation to a current frame data by using the motion displacement; (e) calculating a difference between a previous frame data and the compensated current frame data; and (f) detecting the flicker by using the difference calculated in step (e).
 2. The flicker detection method as recited in claim 1, wherein step (b) excludes the luminance difference from a summation if the luminance difference is less than the threshold value.
 3. The flicker detection method as recited in claim 2, wherein the flicker is partially removed by steps (a) and (b).
 4. The flicker detection method as recited in claim 3, wherein steps (a) and (b) use one line memory.
 5. The flicker detection method as recited in claim 4, wherein step (a) calculates the luminance difference between the neighboring pixels in one line.
 6. The flicker detection method as recited in claim 5, wherein the predetermined direction is one of a row direction and a column direction.
 7. The flicker detection method as recited in claim 6, wherein step (c), an initial position of the motion estimation is decided depending on a search range.
 8. The flicker detection method as recited in claim 7, wherein step (c) includes the steps of: calculating a sum of absolute difference (SAD) from the initial position to a block size of a search window; and selecting the least SAD as the motion displacement.
 9. The flicker detection method as recited in claim 8, wherein step (d) includes a step of moving the previous frame data as much as the motion displacement of the compensated current frame data.
 10. The flicker detection method as recited in claim 9, wherein step (e) uses a sum of a plurality of pixels in the specific direction.
 11. The flicker detection method as recited in claim 10, wherein the specific direction is one of a row direction and a column direction.
 12. The flicker detection method as recited in claim 11, wherein step (f) includes the steps of: filtering the difference between the previous frame data and the compensated current frame data to thereby detect a plurality of local minima; and detecting a flicker period by using the local minima.
 13. The flicker detection method as recited in claim 12, wherein the flicker period is used for determining whether the flicker is occurred or not.
 14. The flicker detection method as recited in claim 11, wherein step (f) includes the steps of: filtering the difference between the previous frame data and the compensated current frame data to thereby detect a plurality of local maxima; and detecting a flicker period by using the local maxima.
 15. The flicker detection method as recited in claim 14, wherein the flicker period is used for determining whether the flicker is occurred or not.
 16. The flicker detection method as recited in claim 4, wherein step (a) calculates the luminance difference between the neighboring pixels, wherein each of the neighboring pixels are placed in neighboring two lines, respectively.
 17. The flicker detection method as recited in claim 16, wherein the predetermined direction is one of a row direction and a column direction.
 18. The flicker detection method as recited in claim 17, wherein step (c), an initial position of the motion estimation is decided depending on a search range.
 19. The flicker detection method as recited in claim 18, wherein step (c) includes the steps of: calculating a sum of absolute difference (SAD) from the initial position to a block size of a search window; and selecting the least SAD as the motion displacement.
 20. The flicker detection method as recited in claim 19, wherein step (d) includes a step of moving the previous frame data as much as the motion displacement of the compensated current frame data.
 21. The flicker detection method as recited in claim 20, wherein step (e) uses a sum of a plurality of pixels in the specific direction.
 22. The flicker detection method as recited in claim 21, wherein the specific direction is one of a row direction and a column direction.
 23. The flicker detection method as recited in claim 22, wherein step (f) includes the steps of: filtering the difference between the previous frame data and the compensated current frame data to thereby detect a plurality of local minima; and detecting a flicker period by using the local minima.
 24. The flicker detection method as recited in claim 23, wherein the flicker period is used for determining whether the flicker is occurred or not.
 25. The flicker detection method as recited in claim 24, wherein step (f) includes the steps of: filtering the difference between the previous frame data and the compensated current frame data to thereby detect a plurality of local maxima; and detecting a flicker period by using the local maxima.
 26. The flicker detection method as recited in claim 25, wherein the flicker period is used for determining whether the flicker is occurred or not. 